/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: Lenovo
 * Date: 2025-07-02
 * Time: 23:50
 */
public class Test {
    public static void main(String[] args) {
        tree root=new tree();
        root=root.createTree();
        System.out.print("前序");
        root.preOrder(root);
        System.out.println();
        System.out.print("中序");
        root.inOrder(root);
        System.out.println();
        System.out.print("后序");
        root.postOrder(root);
        System.out.println();
        System.out.println("树的结点个数"+root.size2(root));
        System.out.println("树的叶子个数"+root.leafNodeSize2(root));
        System.out.println("第3层结点个数"+root.getKLevelNodeCount(root,3));
        System.out.println("树的高度"+root.getHeight(root));
        System.out.println(root.find(root,'D'));

    }
}
